package com.sdx.console.planItem.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.planItem.dao.PlanItemDao;
import com.sdx.console.planItem.entity.PlanItem;
import com.ibeetl.admin.core.service.BaseService;

/**
 * OCR计划 Service
 */

@Service
@Transactional
public class PlanItemService extends BaseService<PlanItem>{

    @Resource
	private PlanItemDao planItemDao;

    public PageQuery<PlanItem>queryByCondition(PageQuery query){
        PageQuery ret =  planItemDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelPlanItem(List<String> ids){
        try {
            planItemDao.batchDelPlanItemByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除OCR计划失败", e);
        }
    }

	public List<PlanItem> all() {
		return planItemDao.all();
		}
}